package com.mcms.web.control;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.validation.BindException;
import org.springframework.web.servlet.ModelAndView;
import org.springframework.web.servlet.mvc.AbstractCommandController;

import com.mcms.service.UserService;
import com.mcms.web.LoginCommand;

/**
 * 满意度调查管理
 * @author 
 */
public class AtisfactionManager extends AbstractCommandController {
	private UserService userService;

	public AtisfactionManager() {
		setCommandClass(LoginCommand.class);
	}

	public void setUserService(UserService userService) {
		this.userService = userService;
	}

	protected ModelAndView handle(HttpServletRequest request,
			HttpServletResponse response, Object command, BindException errors)
			throws Exception {
		
		/**参数获取*/
		String actionType = request.getParameter("actionType");// 控制跳转参数
		String userName = request.getParameter("userName");
		String deptCode = request.getParameter("deptCode");
		String customid = request.getParameter("customid");
		
		System.out.println("at:"+actionType+";un:"+userName+";customid:"+customid);
		
		/**登陆页跳转*/
		if(actionType!=null && actionType.trim().length()>0){
			if(actionType.equals("")){
				if(deptCode!=null && deptCode.trim().length()>0 ){
					if(deptCode.equalsIgnoreCase("")){
						return new ModelAndView(""); 
					}
				}
				return new ModelAndView(""); 
			}
			
		}
		
		/**默认跳转至登陆页面*/
		return new ModelAndView("login");

	}
}